package com.tangruojie.controller;

import com.tangruojie.domain.ResponseCode;
import com.tangruojie.domain.ResponseResult;
import com.tangruojie.service.LogoutService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/logout")
@RequiredArgsConstructor
public class LogoutController {

    private final LogoutService logoutService;

    @GetMapping("/user")
    public ResponseResult logout() {
        logoutService.logout();
        return new ResponseResult(
                ResponseCode.LOGOUT_SUCCESS,
                "登出成功",
                null
        );
    }

}
